import { service } from '@/service'

enum Api {
  list = 'system/user/list',
  tree = 'system/user/deptTree',
  role = 'system/role/optionselect',
  setRole = 'system/role/authUser/selectAll'
}

export const userList = (params: any) => {
  return service.request({
    url: Api.list,
    method: 'GET',
    params
  })
}

export const treeList = (params?: any) => {
  return service.request({
    url: Api.tree,
    method: 'GET',
    params
  })
}

export const roleList = (params?: any) => {
  return service.request({
    url: Api.role,
    method: 'GET',
    params
  })
}

export const setRole = (data?: any) => {
  return service.request({
    url: Api.setRole,
    method: 'post',
    data
  })
}
